Skip to content

Conversation

@Boulaouaney
Copy link

Summary

Adds support for the uv package manager to both Unix and Windows installation scripts, providing 10-100x faster package installation while maintaining full backwards compatibility with pip.

Changes

  • Unix (install.sh): Added ensure_uv() function and uv-based venv/package installation
  • Windows (install.ps1): Added Install-Uv function and uv-based installation flow
  • Both scripts gracefully fall back to pip if uv installation fails
  • Added --no-uv flag (Unix) and -NoUv parameter (Windows) to explicitly use pip
  • Added HF_CLI_USE_UV environment variable (defaults to true)

Benefits

  • Significantly faster installation times (10-100x speedup in package resolution and installation)
  • Better dependency resolution
  • Zero breaking changes - existing workflows continue to work
  • Automatic fallback ensures reliability

Testing

Tested on:

  • ✅ Windows (local)
  • ✅ Linux server (local)

Both platforms work correctly with uv enabled and fall back gracefully to pip when needed.

Backwards Compatibility

  • All existing flags, parameters, and environment variables work unchanged
  • Users who don't have uv will automatically use pip
  • Explicit opt-out available via --no-uv / -NoUv or environment variable

Added support for uv package manager installation and updated installation logic to use uv if available. Modified logging and error handling for better user guidance.
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Boulaouaney , thanks for your interest and for the PR! I like the idea of using uv if it exists but don't think we should add new parameters to the scripts. Also please modify only the parts related to this PR (i.e. do not remove comments or alter existing logic). I have left a few comments to guide you a bit.

If this PR is AI-generated, please let us know in advance and please review the AI-generated diff' to check it really makes sense.

Thanks in advance!

@Boulaouaney
Copy link
Author

@Wauplin thanks for the detailed feedback! I did indeed use Claude Code to refactor, and tested on my home setup through ssh on my phone as I am currently traveling and don't have direct access to a computer.

I will go through and address all your comments as soon as I can.

Boulaouaney and others added 3 commits October 29, 2025 11:30
Removed newly added paramters
Put back comments
Use uv only if installed
Do not create venv with uv
@Boulaouaney Boulaouaney requested a review from Wauplin November 7, 2025 19:12
@Boulaouaney
Copy link
Author

@Wauplin sorry for the delay on the PR. I hope I addressed all of your feedback with my latest commits. Please let me know if I missed sonething

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants